package com.chixing.dao.impl;

import com.chixing.dao.DeptDao;
import com.chixing.dao.JdbcTemplate;
import com.chixing.pojo.Dept;

import java.util.List;

public class DeptDaoImpl  implements DeptDao {
    private JdbcTemplate<Dept> jdbcTemplate;


    @Override
    public Dept selectByPrimaryKey(int primaryKey) {

        String sql = "select deptno,dname,loc from dept where deptno = ?";
        Object[] args = {primaryKey};
        return jdbcTemplate.queryForObject(sql,args);
    }

    @Override
    public List<Dept> selectAll() {
        String sql ="select deptno,dname,loc form dept";
        return jdbcTemplate.queryForList(sql,null);
    }

    @Override
    public int insert(Dept obj) {
        return 0;
    }

    @Override
    public int update(Dept obj) {
        return 0;
    }

    @Override
    public int delete(int primaryKey) {
        return 0;
    }
}
